<?php
class Application_model extends CI_Model{
	function __construct(){
        // Call the Model constructor
        parent::__construct();
    }
    public function getListApplication($params){
    	$result = array();
    	try{
    		$query = $this->db->query("CALL backend_getAllApplication(".$params['offset'].", ".$params['limit'].")");
    		$result['data'] = $query->result_array();
    		$queryTotal = $this->db->query("SELECT FOUND_ROWS() AS total");
    		$result['total'] = $queryTotal->row()->total;
		}
    	catch(Exception $e){
    		log_message('error', $e->getMessage());
    	}
    	return $result;
    }
}